<?php

namespace app\adm\model;

use think\Model;

/**
 * 员工表
 */
class AdminModel extends Model
{

    protected $name = 'admin';


    /**
     * 获取部门所有员工
     * @param array $where
     * @param string $field
     * @return array|bool|object
     */
    public function departmentUserList(array $where = [] , string $field = 'a.id,a.did,a.position_id,a.mobile,a.name,a.nickname,a.sex,a.status,a.thumb,a.username,d.title as department'){
        return $this->db()
            ->field($field)
            ->alias('a')
            ->join('Department d', 'a.did = d.id')
            ->where($where)
            ->select();
    }
}